package com.dl7.mvp.injector.modules;

import com.dl7.mvp.adapter.BaseVideoListAdapter;
import com.dl7.mvp.injector.PerActivity;
import com.dl7.mvp.module.base.IBasePresenter;
import com.dl7.mvp.module.video.player.VideoPlayerActivity;
import com.dl7.mvp.module.video.player.VideoPlayerPresenter;
import com.dl7.recycler.adapter.BaseQuickAdapter;

import dagger.Module;
import dagger.Provides;

@Module
public class VideoPlayerModule {

    private final VideoPlayerActivity mActivity;
    private BaseVideoListAdapter mAdapter;
    // 当前视频所属专辑ID。
    private int mID;

    public VideoPlayerModule(VideoPlayerActivity activity, int id) {
        this.mActivity = activity;
        this.mID = id;
    }

    @PerActivity
    @Provides
    public IBasePresenter providePresenter() {
        return new VideoPlayerPresenter(mActivity, mID);
    }

    @PerActivity
    @Provides
    public BaseQuickAdapter provideAdapter() {
        mAdapter = new BaseVideoListAdapter(mActivity);
        return mAdapter;
    }
}
